package com.masterclient.app.businessmodule.vipmodule.financial_management.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.eoner.baselibrary.utils.Utils;
import com.masterclient.app.R;
import com.masterclient.app.businessmodule.vipmodule.financial_management.bean.RechargeRecordBean;

import java.math.BigDecimal;

public class RechargeRecordAdapter extends BaseQuickAdapter<RechargeRecordBean, BaseViewHolder> {

    public RechargeRecordAdapter() {
        super(R.layout.item_finanacial_purchase);
    }

    @Override
    protected void convert(BaseViewHolder helper, RechargeRecordBean item) {

            helper.setText(R.id.item_finanacial_purchase_title,item.getRecharge_status_text()!=null?
                    item.getRecharge_status_text():item.getWithdraw_status_text())
                    .setText(R.id.item_finanacial_purchase_time, item.getCreate_at())
                    .setText(R.id.item_finanacial_purchase_service,new StringBuffer("手续费：¥").append(item.getCharge()).toString())
                  //  .setGone(R.id.item_finanacial_purchase_service, !TextUtils.isEmpty(item.getCharge()))
                    .setText(R.id.item_finanacial_purchase_total,new StringBuffer("¥")
                            .append(Utils.decimalFormat(new BigDecimal(item.getAmount()))).toString())
                    .setGone(R.id.item_finanacial_purchase_line,helper.getAdapterPosition() != getData().size()-1);



    }
}
